package com.yidu.menuProject.commont;

import java.net.URLEncoder;



/**
 * 验证码通知短信接口
 * 
 * @ClassName: IndustrySMS
 * @Description: 验证码通知短信接口
 *
 */
public class IndustrySMS
{
	private static String operation = "/industrySMS/sendSMS";
	//private static int a = 1232;
	private static String accountSid = Config.ACCOUNT_SID;
	//private static String to = "15580244138";
	//private static String smsContent = "【楠竹计划】您的验证码为{"+a+"}，请于{2}分钟内正确输入，如非本人操作，请忽略此短信。";

	/**
	 * 验证码通知短信
	 * 参数content：
	 * <p>
	 * "【楠竹计划】您的验证码为{"+a+"}，请于{2}分钟内正确输入，如非本人操作，请忽略此短信。";
	 * </p>
	 * 参数toPhone：
	 * <p>对方手机号码</p>
	 */
	public static void execute(String content,String toPhone)
	{
		String tmpSmsContent = null;
	    try{
	      tmpSmsContent = URLEncoder.encode(content, "UTF-8");
	    }catch(Exception e){
	      
	    }
	    String url = Config.BASE_URL + operation;
	    String body = "accountSid=" + accountSid + "&to=" + toPhone + "&smsContent=" + tmpSmsContent
	        + HttpUtil.createCommonParam();

	    // 提交请求
	    String result = HttpUtil.post(url, body);
	    System.out.println("result:" + System.lineSeparator() + result);
	}
}
